<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategorysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categorys', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->notNull()->default('')->comment('类型名称');
            $table->string('logo')->notNull()->default('')->comment('分类logo');
            $table->integer('parent_id')->notNull()->default(0)->comment('归类的上级分类');
            $table->tinyInteger('status')->notNull()->default(0)->comment('是否禁用 0否 1是');
            $table->integer('admin_id')->notNull()->default(0)->comment('添加管理员id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categorys');
    }
}
